<?php
/**
 * Dao of Customer
 *
 * @author fsqijy
 */


require_once BaseUtil::getModulePath("base") . '/models/BaseDao.php';

class MetadataGroupDao extends BaseDao{

    protected $_name;

    public function  _setup() {
        $this->_name = $this->prefix() . "metadata_groups";
        parent::_setup();
    }

    public function addSetData($data){
         //$where = $this->db_w->quoteInto('id = ?', $id);
         return $this->insertData($data);
    }
    
    public function getGroupBySetId($setId){
    	return $this->db_r->fetchAll ( "select 	* 
    									from 	$this->_name 
    									where 	metadata_set_id = $setId 
    									and 	is_delete = 0
    									order	by sort_order" );
    }

    public function getMaxOrder($setId){
    	return $this->db_r->fetchRow ( "select 	max(sort_order) num
    									from 	$this->_name 
    									where 	metadata_set_id = $setId 
    									and 	is_delete = 0" );
    }
}
